package structs

type BaseConfig struct {
	Key            KeyConf               `yaml:"Key"`
	HttpConf       HttpConf              `yaml:"HttpConf"`
	TimeZone       TimeZone              `yaml:"TimeZone"`
	MysqlConf      MysqlConf             `yaml:"MysqlConf"`
	RedisConfig    RedisConfig           `yaml:"RedisConfig"`
	RabbitMQConfig RabbitMQConfig        `yaml:"RabbitMQConfig"`
	MinIO          map[string]*MinIOConf `yaml:"MinIO"`
	DebugMode      string                `yaml:"DebugMode"`
	Environment    string                `yaml:"Environment"`
}

// KeyConf key配置
type KeyConf struct {
	AuthKey     string `yaml:"AuthKey"`
	SignKey     string `yaml:"SignKey"`
	ApiAesKey   string `yaml:"ApiAesKey"`
	LoginAesKey string `yaml:"LoginAesKey"`
	EncryptKey  string `yaml:"EncryptKey"`
	// PayKey      string `yaml:"PayKey"` // 支付密钥
}

// TimeZone 时间规格
type TimeZone struct {
	Zone string `yaml:"Zone"`
	Time int    `yaml:"Time"`
}

// HttpConf http配置
type HttpConf struct {
	Addr           string `yaml:"Addr"`
	TimestampCheck bool   `yaml:"TimestampCheck"`
	EncryptCheck   bool   `yaml:"EncryptCheck"`
}

// List 数据库配置文件
type List struct {
	DriverName      string `yaml:"DriverName"`
	DataSourceName  string `yaml:"DataSourceName"`
	MaxOpenConn     int    `yaml:"MaxOpenConn"`
	MaxIdleConn     int    `yaml:"MaxIdleConn"`
	MaxConnLifeTime int    `yaml:"MaxConnLifeTime"`
	Prefix          string `yaml:"Prefix"`
}

// MysqlConf
type MysqlConf struct {
	List  map[string]*List `yaml:"List"`
	Split int              `yaml:"Split"`
}

// RedisConfig : REDIS配置文件结构
type RedisConfig struct {
	Host     string `yaml:"Host"`
	Port     string `yaml:"Port"`
	Password string `yaml:"Password"`
	DB       int    `yaml:"DB"`
}

// RabbitMQConfig : RabbitMQ配置文件结构
type RabbitMQConfig struct {
	Host     string `yaml:"Host"`
	Port     string `yaml:"Port"`
	UserName string `yaml:"UserName"`
	PassWord string `yaml:"PassWord"`
}

// MinIOConf : MinIO配置文件结构
type MinIOConf struct {
	Endpoint        string   `yaml:"Endpoint"`
	AccessKeyID     string   `yaml:"AccessKeyID"`
	SecretAccessKey string   `yaml:"SecretAccessKey"`
	UseSSL          bool     `yaml:"UseSSL"`
	AllowBucket     []string `yaml:"AllowBucket"`
}
